home *** CD-ROM | disk | FTP | other *** search
- Path: user1.mnsinc.com!keys
- From: keys@mnsinc.com (Paul Speed)
- Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
- Subject: Re: Young programmers read me.
- Followup-To: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
- Date: 11 Apr 1996 14:10:01 GMT
- Organization: Monumental Network Systems
- Message-ID: <4kj3rp$11d@news1.mnsinc.com>
- References: <4icpp9$7hr@barad-dur.nas.com> <aidan-0404961557290001@meathook.intac.com> <3165AD94.6F3A@datalytics.com> <j-jahnke-0604960016160001@ntcs-ip8.uchicago.edu> <4keejc$lpi@tpd.dsccc.com> <Pine.OSF.3.91.960411093444.20958D-100000@bud.cc.swin.edu.au> <gfarrow.829193316@rainbow>
- NNTP-Posting-Host: user.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Glenn Farrow (gfarrow@rainbow.rmii.com) wrote:
- : John Joseph Newbigin <079519@bud.cc.swin.edu.au> writes:
-
- : >But it is a lot easier to read
-
- : >if(something_happened)
- : >{
- : > do_something_else();
- : >}
- : >is_n't_it(); :)
-
- : Nonesense. This style is extremely annoying because it spreads the code out
- : too much, it increases the amount you have to page around a source file.
- : Putting "{" on a separate line is a waste of space that should be occupied
- : by code.
-
- : Glenn
-
-
- Sure, I can understand that this might be a problem if you're
- still using edlin. :) This is really a personal preference issue and
- nobody is going to change anyone else's mind. My problem with the less
- space argument is that it implies that you don't comment your code either.
- Not to mention the fact that you might as well shove most of your code
- onto the same lines, only line-breaking when absolutely needed.
-
- void foo(int i, char *list){int t;for(t=0;t<i;t++){printf("#%i",t);
- printf("%s\n",list[t]);}printf("%i total.\n",t);}
-
- Wow! Look at how much space that saved. I could put all my code
- in just two or three pages. :) I much prefer.
-
- /* Function to do nothing
- * Parms: i = num of items, list = list of items */
- void foo(int i, char *list)
- {
- int t;
-
- /* Go through entire list */
- for(t = 0; t < i; t++)
- {
- /* Write the item to stdout */
- printf("#%i ", t);
- printf("%s\n", list[t]);
- }
-
- /* Sum it up */
- printf("%i total.\n", t);
- }
-
- When you waste brain cycles to decipher code that's been crammed
- together, you lose some cycles you could have been using to do something
- else.
-
- -Keys
-
-